home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.46 / stinglibpcq / source / insert.p < prev    next >
Text File  |  1995-03-27  |  384b  |  24 lines

  1. external;
  2.  
  3. {$I "include:utils/stringlib.i"}
  4.  
  5. function Str_Insert(s,s1 : string;pos : integer) : string;
  6.  
  7. var
  8.     s2  : string;
  9.     l,c : integer;
  10.  
  11. begin
  12.     l := strlen(s1);
  13.     s2 := allocstring(strlen(s)+l+1);
  14.     pos := pos - 1;
  15.     for c := 0 to (pos-1) do
  16.         s2[c] := s[c];
  17.     for c := 0 to (l-1) do
  18.         s2[c+pos] := s1[c];
  19.     for c := pos to (strlen(s)-1) do
  20.         s2[c+l] := s[c];
  21.     Str_Insert := s2;
  22. end;
  23.  
  24.